package com.asimasoft.cncRouter;

import org.eclipse.jface.action.ICoolBarManager;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.plugin.AbstractUIPlugin;

import controles.interfaz.Abrir;

public class ApplicationActionBarAdvisor extends ActionBarAdvisor {

    public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
        super(configurer);
    }

    private IWorkbenchAction abrir;
    private IWorkbenchAction salir;
    private IWorkbenchAction acercade;
    //private RetargetAction zoomIn;

    
    protected void makeActions(IWorkbenchWindow window) {
        abrir = new Abrir(window);
        abrir.setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin("com.asimasoft.cncRouter", "icons/document-open.png") );
        register(abrir);
        salir = ActionFactory.QUIT.create(window);
        salir.setText("Salir");
        register(salir);
        acercade = ActionFactory.ABOUT.create(window);
        register(acercade);

        //zoomIn = new RetargetAction("cncRouter.zoomIn","Zoom In");
        //zoomIn.setToolTipText("Acercar Zoom");
        
        
        //zoomIn.setImageDescriptor(ImageDescriptor)
        
        
    }

    protected void fillMenuBar(IMenuManager menuBar) {
        MenuManager menuProyecto = new MenuManager(
                "&Proyecto", "proyecto");
            menuProyecto.add(abrir);
            menuProyecto.add(salir);
            MenuManager menuAyuda = new MenuManager("&Ayuda", "ayuda");
            menuAyuda.add(acercade);
            menuBar.add(menuProyecto);
            menuBar.add(menuAyuda);

    }
    
    protected void fillCoolBar(ICoolBarManager coolBar) {
    	IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle());
    	coolBar.add(toolbar);
    	toolbar.add(abrir);
    	toolbar.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    }

    
    
    
}
